<form name="$ctrl.$form" class="my-form">
  userType:
  <!-- ng-model 作用是传输到form上 -->
  <input
    name="input"
    class="form-control"
    ng-pattern="/\d+$/"
    ng-model="$ctrl.userType"
    ng-model-options="$ctrl.modelOptions"
    placeholder="Enter a number(only)"
    required
  >
  <span class="error" ng-show="$ctrl.$form.input.$error.required"
    >Required!</span
  ><br />
  <code>userType = {{$ctrl.userType}}</code><br />
  <code>$ctrl.$form.input.$modelValue = {{$ctrl.$form.input.$modelValue}}</code
  ><br />
  <div>form.input</div>
  <code>$form.input = {{$ctrl.$form.input}}</code>
  <code>$form.input.$valid = {{$ctrl.$form.input.$valid}}</code><br />
  <code>$form.input.$invalid = {{$ctrl.$form.input.$invalid}}</code><br />
  <code>$form.input.$error = {{$ctrl.$form.input.$error}}</code><br />
  <div>form</div>
  <code>$form = {{$ctrl.$form}}</code><br />
  <code>$form.$valid = {{$ctrl.$form.$valid}}</code><br />
  <code>$form.$invalid = {{$ctrl.$form.$invalid}}</code><br />
  <code>$form.$error.required = {{!!$ctrl.$form.$error.required}}</code><br />
</form>
